import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:health/route/path.dart';

void main() {
  GetStorage.init();
  SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
    statusBarIconBrightness: Brightness.light,
    statusBarColor: Colors.transparent,
  ));
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
        title: '大健康',
        theme: ThemeData(fontFamily: 'Regular'),
        debugShowCheckedModeBanner: false,
        locale: const Locale('zh', 'CN'),
        supportedLocales: const [Locale('zh', 'CN'), Locale('en', 'US')],
        localizationsDelegates: const [
          GlobalMaterialLocalizations.delegate,
          GlobalWidgetsLocalizations.delegate,
          GlobalCupertinoLocalizations.delegate,
        ],
        initialRoute: RoutePath.home,
        getPages: RoutePath.pages,
        transitionDuration: const Duration(milliseconds: 500),
        defaultTransition: Transition.cupertino,
        navigatorObservers: [
          GetObserver((Routing? routing) {}, Routing()),
        ],
        routingCallback: (routing) {
          Get.log('routing = $routing');
        });
  }
}
